package com.wandian.news.adapter;

import android.text.Html;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wandian.news.R;
import com.wandian.news.bean.KnowledgeXHZDBean;


/**
 * @author Administrator
 * @date 2019/12/16-13:32
 * @description 适配器
 **/
public class KnowledgeXHZDRecycleAdapter extends BaseQuickAdapter<KnowledgeXHZDBean.NewslistEntity, BaseViewHolder> {

    public KnowledgeXHZDRecycleAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper,KnowledgeXHZDBean.NewslistEntity item) {
        TextView tv_hanzi = helper.getView(R.id.tv_hanzi);
        tv_hanzi.setText("汉字："+item.getHanzi());
        TextView tv_py = helper.getView(R.id.tv_py);
        tv_py.setText("拼音："+item.getPy());
        TextView tv_wubi = helper.getView(R.id.tv_wubi);
        tv_wubi.setText("五笔："+item.getPy());
        TextView bushou = helper.getView(R.id.tv_bushou);
        bushou.setText("部首："+item.getBishun());
        TextView tv_bihua = helper.getView(R.id.tv_bihua);
        tv_bihua.setText("笔画："+item.getBishun());
        TextView tv_pyyb = helper.getView(R.id.tv_pyyb);
        tv_pyyb.setText("读音："+item.getPyyb());
        TextView tv_content = helper.getView(R.id.tv_content);
        tv_content.setText("内容："+Html.fromHtml(item.getContent()+""));
        TextView tv_explain = helper.getView(R.id.tv_explain);
        tv_explain.setText("详细解释："+Html.fromHtml(item.getExplain()+""));
    }


}
